package cn.lizemin.observer.version1.entity;

/**
 * @author lzm
 * @version 1.0
 * @description: TODO
 * @date 2022/4/20 11:22
 */
public class AppleBuyer extends Buyer{

    public AppleBuyer(String name) {
        this.name = name;
    }

    @Override
    protected void buy(String product) {
        if (product.contains("苹果")) {
            System.out.println(name + "买到了" + product);
        }
    }

    /**
     * 由于抽象方法不能用在非抽象类中，我们只能将其放在抽象类中
     */
//    public abstract buy();

    /*public void buy(String product) {
        if (product.contains("手机")) {
            System.out.println(name + "买到了" + product);
        }
    }*/

}
